package com.wanbangee.marksystem.service.imp;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wanbangee.marksystem.dao.MAnswerSheetRecordDao;
import com.wanbangee.marksystem.dao.MExamMarkerDao;
import com.wanbangee.marksystem.entities.MAnswerSheetRecord;
import com.wanbangee.marksystem.entities.MExamMarker;
import com.wanbangee.marksystem.service.IExamInfoService;

@Service
public class ExamInfoServiceImpl implements IExamInfoService{
	
	@Autowired
	private MExamMarkerDao mExamMarkerDao;
	@Autowired
	private MAnswerSheetRecordDao mAnswerSheetRecordDao;

	/**
	 * 根据阅卷老师id，学校id，查询考试信息
	 * @param teaId
	 * @param schId
	 * @return
	 */
	@Override
	public List<MExamMarker> selectExamInfoByExamIdAndTopicNo(Integer teaId, Integer schId) {
		return this.mExamMarkerDao.selectExamInfoByExamIdAndTopicNo(teaId, schId);
	}

	/**
	 * 根据仲裁老师id，查询考试信息
	 * @param teaId
	 * @param schId
	 * @return
	 */
	@Override
	public List<MExamMarker> selectArbitrationExamInfoByTeaIdAndSchId(Integer teaId, Integer schId) {
		return this.mExamMarkerDao.selectArbitrationExamInfoByTeaIdAndSchId(teaId, schId);
	}

	
	/**
	 * 根据学科负责人id，查询考试信息
	 * @param teaId
	 * @param schId
	 * @param recordType 查询类别————未处理：1,已处理：4
	 * @return
	 */
	@Override
	public List<MAnswerSheetRecord> selectProblemExamInfoByTeaIdAndSchId(Integer teaId, Integer schId, Integer recordType) {
		return this.mAnswerSheetRecordDao.selectProblemExamInfoByTeaIdAndSchId(teaId,schId,recordType);
	}
	
	/**
	 * 根据recordId，查询具体题目信息（问题卷）
	 * @param recordId
	 * @return
	 */
	public MAnswerSheetRecord selectProblemTestExamInfoByRecordId(@Param("recordId")Integer recordId) {
		return this.mAnswerSheetRecordDao.selectProblemTestExamInfoByRecordId(recordId);
	}

	/**
	 * 根据recordId，修改问题卷类型（修改为已处理问题卷）
	 * @param recordId
	 * @return
	 */
	public Integer updateProblemTestInfoByRecordId(Integer recordId) {
		return this.mAnswerSheetRecordDao.updateProblemTestInfoByRecordId(recordId);
	}
}
